package com.tbit.main.controller;

import com.tbit.main.common.JsonResult;
import com.tbit.main.pojo.PowerChangeMonitorConfig;
import com.tbit.main.service.PowerChangeMonitorConfigService;
import com.tbit.main.util.Assert;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 电量区间配置
 *
 * @Author: chen
 * @Description:
 * @Date: 创建于 13:46 2023/2/20
 */
@RestController
@RequestMapping("/monitorConfig")
public class PowerChangeMonitorConfigController {

    @Autowired
    private PowerChangeMonitorConfigService powerChangeMonitorConfigService;

    /**
     * 获取区域电量区间配置
     *
     * @param accountId
     * @return
     */
    @RequestMapping("/getByAccountId")
    public JsonResult getByAccountId(Integer accountId) {
        Assert.notNull(accountId, "AccountUser.agentId.notNull");
        PowerChangeMonitorConfig powerChangeMonitorConfig = powerChangeMonitorConfigService.getByAccountId(accountId);
        return JsonResult.succ(powerChangeMonitorConfig);
    }
}
